home *** CD-ROM | disk | FTP | other *** search
- # loading this file sets up the procedures "dbos" and "_dbos" and "unos"
- #
- # execute dbos to set up GEMDOS debugging using breakpoint slots 0 and 1.
- # execute unos to remove GEMDOS debugging
- #
- # _dbos is executed by dbos. Its argument, argsp, is the sp at which
- # to start looking for arguments. The program RAMTRAP1.PRG can be run
- # to install a RAM hook at the entrance to and exit from trap 1, in
- # such a way that the correct argsp is in a0 at the place where dbos
- # sets its breakpoint. For PEXEC calls, it's just on the entrance
- # to trap 1.
- #
-
- global dbos_ret
-
- procedure _dbos argsp
- local fc warg1 larg1
-
- x dbos_ret 1
- xfc (wpeek `argsp)
- xargsp (+ `argsp 2)
- xwarg1 (wpeek `argsp)
- xlarg1 (lpeek `argsp)
-
- #nothing for 1-b or 10-13 (I/O functions)
- if (|| (&& (< `fc 14) (> `fc f)) (&& (< `fc c) (> `fc 0))) \
- "echo -n;xdbos_ret 0; goto end"
- if (== `fc 0) "echo -n Pterm0 ; goto end"
- if (== `fc e) "print -n Dsetdrv `warg1 ; goto end"
- if (== `fc 19) "echo -n Dgetdrv ; goto end"
- if (== `fc 1a) "print -n Fsetdta `larg1 ; goto end"
- if (== `fc 20) "print -n Super `larg1 ; goto end"
- if (== `fc 2a) "echo -n Tgetdate ; goto end"
- if (== `fc 2b) "print -n Tsetdate `warg1 ; goto end"
- if (== `fc 2c) "echo -n Tgettime ; goto end"
- if (== `fc 2d) "print -n Tsettime `warg1 ; goto end"
- if (== `fc 2f) "echo -n Fgetdta ; goto end"
- if (== `fc 30) "echo -n Sversion ; goto end"
- if (== `fc 31) "print -n Ptermres `larg1 (wpeek (+ `argsp 4)) ; goto end"
- if (== `fc 36) "print -n Dfree `larg1 (wpeek (+ `argsp 4)) ; goto end"
- if (== `fc 39) "print -n Dcreate -s `larg1 ; goto end"
- if (== `fc 3a) "print -n Ddelete -s `larg1 ; goto end"
- if (== `fc 3b) "print -n Dsetpath -s `larg1 ; goto end"
- if (== `fc 3c) "print -n Fcreate -s `larg1 -x (wpeek (+ `argsp 4)) ; goto end"
- if (== `fc 3d) "print -n Fopen -s `larg1 -x (wpeek (+ `argsp 4)) ; goto end"
- if (== `fc 3e) "print -n Fclose `warg1 ; goto end"
- if (== `fc 3f) "print -n Fread `warg1 (lpeek (+ `argsp 2)) (lpeek (+ `argsp 6)) ; goto end"
- if (== `fc 40) "print -n Fwrite `warg1 (lpeek (+ `argsp 2)) (lpeek (+ `argsp 6)) ; goto end"
- if (== `fc 41) "print -n Fdelete -s `larg1 ; goto end"
- if (== `fc 42) "print -n Fseek offset: `larg1 handle: (wpeek (+ `argsp 4)) mode: (wpeek (+ `argsp 6)) ; goto end"
- if (== `fc 43) "print -n Fattrib -s `larg1 -x wflag: (wpeek (+ `argsp 4)) attr: (wpeek (+ `argsp 6)) ; goto end"
- if (== `fc 44) "print -n NMalloc amt: `larg1 mode: (wpeek (+ `argsp 4));goto end"
- if (== `fc 45) "print -n Fdup `warg1 ; goto end"
- if (== `fc 46) "print -n Fforce `warg1 to the same as (wpeek (+ `argsp 2)) ; goto end"
- if (== `fc 47) "print -n Dgetpath `larg1 (wpeek (+ `argsp 2)) ; goto end"
- if (== `fc 48) "print -n Malloc `larg1 ; goto end"
- if (== `fc 49) "print -n Mfree `larg1 ; goto end"
- if (== `fc 4a) "print -n Mshrink 0 (lpeek (+ `argsp 2)) (lpeek (+ `argsp 6)) ; goto end"
- if (== `fc 4b) "print Pexec mode: `warg1 (lpeek (+ `argsp 2)) (lpeek (+ `argsp 6)) (lpeek (+ `argsp a)) ; goto end"
- if (== `fc 4c) "print -n Pterm `warg1 ; goto end"
- if (== `fc 4e) "print -n Fsfirst -s `larg1 -x (wpeek (+ `argsp 4)) ; goto end"
- if (== `fc 4f) "echo -n Fsnext ; goto end"
- if (== `fc 56) "print -n Frename -s (lpeek (+ `argsp 2)) (lpeek (+ `argsp 6)) ; goto end"
- if (== `fc 57) "print -n Fdatime buf: `larg1 handle: (wpeek (+ `argsp 4)) wflag: (wpeek (+ `argsp 6))"
- #:end
- .
-
- procedure ramtrap1
- local ptr
- x ptr (- (lpeek 84) $c)
- if (! (= (lpeek `ptr) 524d5431)) abort ramtrap1.prg not installed.
- b#0 (lpeek (+ `ptr 4))
- b#1 (lpeek (+ `ptr 8))
- alias br0 "_dbos `a0;defer g"
- alias br1 "if `dbos_ret print returns `d0;defer g"
- echo dbos installed
- .
-
- alias ramgemdos "b#0 .osif;fw._gouser[40] 4e73;b#1 $; \
- alias br0 '_dbos (lpeek (+ `sp 4));defer g' ;\
- alias br1 'if `dbos_ret print returns `d0;defer g'"
-
- alias alcgemdos "b#0 (+ .gemdos 6);b#1 (+ .gemdos 8); \
- alias br0 '_dbos `sp;defer g' ; \
- alias br1 'if `dbos_ret print returns `d0;defer g'"
-
- alias nogemdos "nb #0 ; nb #1 ; unalias br0 br1"
-
- echo GEMDOS DEBUGGING LOADED
- echo say ramgemdos for ram-loaded TOS or GEMDOS, or alcgemdos for
- echo Alcyon-style (_trap1 procedure), ramtrap1 if you ran ramtrap1.prg,
- echo and nogemdos to get rid of OS debugging.
-